/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package br.siagefi.model;

import br.siagefi.interfaces.BaseEntity;
import java.io.Serializable;
import java.util.Date;
import java.util.Objects;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 *
 * @author NOTE
 */
@Entity
@Table(name = "funcionario")

@NamedQueries({
@NamedQuery(name = "Funcionario.buscaPorCPF", query = "SELECT f FROM Funcionario f WHERE f.cpf = ?1"),
@NamedQuery(name = "Funcionario.buscaPorMatricula", query = "SELECT f FROM Funcionario f WHERE f.matricula = ?1")})
public class Funcionario extends PessoaFisica implements Serializable, BaseEntity {

    @Column(name = "matricula", length = 10, nullable = false)
    private String matricula;

    @Temporal(TemporalType.DATE)
    @Column(name = "data_desligamento")
    private Date dataDesligamento;
    
    @Temporal(TemporalType.DATE)
    @Column(name = "data_admissao", nullable = false)
    private Date dataAdmissao;

    @Column(name = "tipo_contrato", length = 30, nullable = false)
    private String tipoContrato;
    
    @OneToOne
    @JoinColumn(name = "usuario")
    private Usuario usuario;

    public Funcionario() {
        this.usuario = new Usuario();
    }

    public String getMatricula() {
        return matricula;
    }

    public void setMatricula(String matricula) {
        this.matricula = matricula;
    }

    public Date getDataDesligamento() {
        return dataDesligamento;
    }

    public void setDataDesligamento(Date dataDesligamento) {
        this.dataDesligamento = dataDesligamento;
    }

    public Date getDataAdmissao() {
        return dataAdmissao;
    }

    public void setDataAdmissao(Date dataAdmissao) {
        this.dataAdmissao = dataAdmissao;
    }

    public String getTipoContrato() {
        return tipoContrato;
    }

    public void setTipoContrato(String tipoContrato) {
        this.tipoContrato = tipoContrato;
    }

    public Usuario getUsuario() {
        return usuario;
    }

    public void setUsuario(Usuario usuario) {
        this.usuario = usuario;
    }
    
}
